Two-Dimensional Grids

Now, let us take a look at some simple two-dimensional network structures: the grid, an open topology that might be useful in application areas ranging from image processing to air flow analysis for wing profile design, and its closed counterpart the torus (see figure 2).

Figure: two-dimensional grid and torus
\begin{figure}\scriptsize
\begin{verbatim}
^ ^ ^ ^ ^
\vert \vert \vert \vert...
...vert \vert \vert \vert \vert
v v v v v\end{verbatim}
\normalsize\end{figure}
Their specification in Parallaxis is straightforward, as shown in figure 3. It takes just four transfer-functions to specify the whole grid with each PE owning four data-ports (here called: north, south, east, and west). The torus specification is almost identical; the additional modulo- operator connects opposite boundary-PEs. When considering the grid specification, there are PEs whose neighbor function evaluates to an invalid PE-number: e.g. the PE at position [2,4] would have a right neighbor [2,5], but this is out of bounds as of the grid size fixed in the CONNECTION specification (rows labeled 0 to 3, and columns labeled 0 to 4). By definition, these PEs (called ''boundary-PEs'') simply do not have a connection in that particular direction. Any data exchange to or from the outside will have no effect (see section 4 for more detail).
Figure: grid and torus specification
\begin{figure}\scriptsize
\begin{verbatim}
CONFIGURATION grid [4] [5];
CONNE...
...rus[i,j] -> torus[i, (j-1) mod 5].east;\end{verbatim}
\normalsize\end{figure}